#!/usr/bin/env python
# coding: utf-8

# In[2]:


## 作业练习


# In[3]:


import numpy as np 


# In[4]:


#1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人
class1 = np.random.randint(0,101,(50,3))
class2 = np.random.randint(0,101,(50,3))
class3 = np.random.randint(0,101,(50,3))
class4 = np.random.randint(0,101,(50,3))
class5 = np.random.randint(0,101,(50,3))
class6 = np.random.randint(0,101,(50,3))
display(class1,class2,class3,class4,class5,class6)


# In[5]:


#2.将六个班的考试成绩进行合并得到score
score = np.concatenate((class1,class2,class3,class4,class5,class6))
score


# In[6]:


#3.生成性别数组sex，水平叠加数组sex和score得到data
sex = np.random.randint(0,2,300).reshape(300,1)
sex
data = np.hstack((score,sex))
data


# In[7]:


#4.分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差
print(data.max(axis = 0))#最大值
print(data.min(axis = 0))#最小值
print(data.mean(axis = 0))#平均分
print(np.median(data,axis = 0))#中位数
print(data.std(axis = 0))#标准差

